package com.xxkj.drugtraceability.ui.prescriptiondrugback

import com.xxkj.drugtraceability.base.BaseRepository
import com.xxkj.drugtraceability.bean.*
import com.xxkj.drugtraceability.net.Result
import com.xxkj.drugtraceability.net.WanService

/**
 * author: zhoujingjin
 * created on: 2024/9/10 16:15
 * description:
 */
class PrescriptionDrugBackRepository(private val wanService: WanService):BaseRepository() {

    suspend fun getPreRefundList( prescriptioninfo:String): Result<BaseData<List<PatientDrugData>>> {
        return safeApiCall { executeResponse(wanService.getPreRefundList(prescriptioninfo)) }
    }
    suspend fun getPreDrugRefundList( prescriptioninfo:String): Result<BaseData<List<PrescriptionInfoBean>>> {
        return safeApiCall { executeResponse(wanService.getPreDrugRefundList(prescriptioninfo)) }
    }
    /**
     * 获取溯源码数据
     */
    suspend fun bakeTrugTracCodgIsGather( prescriptioninfo:String): Result<BaseData<DrugDictDataList>> {
        return safeApiCall { executeResponse(wanService.bakeTrugTracCodgIsGather(prescriptioninfo)) }
    }

    /**
     * 保存
     */
    suspend fun finishScanBackDrugCode( prescriptioninfo:String): Result<Any> {
        return safeApiCall { executeResponse(wanService.finishScanBackDrugCode(prescriptioninfo)) }
    }
}